from flask import Flask,Blueprint,make_response
from flask_restful import Api
from flask_cors import *
def createApp():
    # 创建app
    #设置静态资源
    app = Flask(__name__, static_folder='static')
    app.config['SECRET_KEY'] = '123'
    from app import api_bp
    # app注册蓝图 设置api
    app.register_blueprint(api_bp,url_prefix='/api')
    return app



def main():
    if (__name__ == "__main__"):
        app = createApp()
        CORS(app, supports_credentials=True)
        app.run(debug=True,host='0.0.0.0')
main()